package yf.mall.vo.down;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class SumRewardDown {

    @ExcelProperty("名字")
    private String name;

    @ExcelProperty("编号")
    private String code;

    @ExcelProperty("业绩")
    private BigDecimal amount;

    //是否被下面全部截断了
    private Boolean cut = false;


    @ExcelProperty("分红")
    private BigDecimal reward;

    public SumRewardDown(String name, String code, BigDecimal amount, BigDecimal reward) {
        this.name = name;
        this.code = code;
        this.amount = amount;
        this.reward = reward;
    }

    public void add(BigDecimal amount){
        if(this.reward==null){
            this.reward = amount;
        }else {
            this.reward = this.reward.add(amount);
        }
    }
}
